fix(react-router): Preserve sourcemaps.disable when unstable_sentryVitePluginOptions is set - #22945
Merged
Conversation
Member
Author
|
bugbot run |
Contributor
size-limit report 📦
|
Member
Author
|
bugbot run |
…ugin The bundler plugin deletes these files in a `finally` block in `writeBundle` that runs regardless of `sourcemaps.disable`, so forwarding the option removed the maps before `sentryOnBuildEnd` could inject debug IDs and upload them - the same end symptom as the double-injection bug, reached from the other side. Deletion still happens in `sentryOnBuildEnd`, driven by the same user option. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Member
Author
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 1d90d5b. Configure here.
chargome
marked this pull request as ready for review
August 3, 2026 12:15
chargome
requested review from
isaacs,
nicohrubec and
s1gr1d
and removed request for
a team
August 3, 2026 12:15
Lms24
approved these changes
Aug 3, 2026
| expect(mockSentryCliInstance.releases.uploadSourceMaps).not.toHaveBeenCalled(); | ||
| }); | ||
|
|
||
| it('should let top-level sourcemaps.disable override unstable_sentryVitePluginOptions', async () => { |
Member
There was a problem hiding this comment.
hmm didn't we say that unstable options always have precedence? Tbh this is logaf-super-L for me since we can remove unstable options with v11 but was curious on your thoughts either way
Member
There was a problem hiding this comment.
Maybe I misremembered and it's the other way around
Member
Author
There was a problem hiding this comment.
No, you're right actually!
Member
Author
There was a problem hiding this comment.
Was pre-existing, I'll streamline in a follow up
chargome
added a commit
that referenced
this pull request
Aug 3, 2026
…entryVitePluginOptions` is set (#22966) Backport of: #22945 Also flips `sourcemaps.disable` precedence in `sentryOnBuildEnd` so `unstable_sentryVitePluginOptions` wins. This is not part of #22945 as the unstable options will likely disappear there anyway. --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
chargome
added a commit
that referenced
this pull request
Aug 4, 2026
…rce map upload (#22956) This adds a build-time assertion app modelled on `nextjs-sourcemaps`, for react router. It asserts three things about the real build output: - exactly one debug ID per client chunk - source maps with non-empty mappings present in the uploaded artifact bundles - every shipped debug ID backed by an upload. ref #22945 --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A trailing
...unstable_sentryVitePluginOptionsspread sat aftersourcemaps: { disable: true }, and object spread replaces whole keys rather than deep-merging — so any user-suppliedsourcemapsobject droppeddisable. The Vite plugin then injected a second debug ID on top of the one fromsentryOnBuildEnd.The spread now sits between the plain options and the field-wise merged objects: it can still
override flat keys (its documented contract) but can't replace
sourcemaps,release,_metaOptionsorreactComponentAnnotation.supersedes #22930 — credit to @okxint for the same diagnosis.
closes #22929